package com.example.dc.utils;

import com.aliyun.dysmsapi20170525.Client;
import com.aliyun.tea.*;
import com.aliyun.dysmsapi20170525.*;
import com.aliyun.dysmsapi20170525.models.*;
import com.aliyun.teaopenapi.*;
import com.aliyun.teaopenapi.models.*;

public class SendMessage {

    public static void main(String[] args_) throws Exception {
        Config config = new Config()
                //这里修改为我们上面生成自己的AccessKey ID
                .setAccessKeyId("LTAI5tMKVUnr6rbRxjJvsko1")

                //这里修改为我们上面生成自己的AccessKey Secret
                .setAccessKeySecret("6d6xDTLtrdqmHD3JCUmDhk3h5QlFLh");
        // 访问的域名
        Client client = new Client(config);
        SendSmsRequest sendSmsRequest = new SendSmsRequest()
                .setSignName("光伴")//短信签名
                .setTemplateCode("光伴")//短信模板
                .setPhoneNumbers("18098342676")//这里填写接受短信的手机号码
                .setTemplateParam("{\"code\":\"1234\"}");//验证码
        // 复制代码运行请自行打印 API 的返回值
        client.sendSms(sendSmsRequest);
    }
}